package com.example.shop_2305.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.lib_base.room.MessageEntity
import com.example.shop_2305.R
import com.example.shop_2305.utils.GlideUtils

class MessageAdapter:BaseQuickAdapter<MessageEntity,BaseViewHolder>(R.layout.item_message) {
    override fun convert(holder: BaseViewHolder, item: MessageEntity) {
        holder.setText(R.id.msg_name,item.user_name)
        holder.setText(R.id.msg_createtime,item.create_time)
        holder.setText(R.id.msg_msg,item.user_image)
        if(item.img1!=""){
            item.img1?.let { GlideUtils.loadNormal(context, it,holder.getView(R.id.msg_img1)) }
        }
        if(item.img2!=""){
            item.img2?.let { GlideUtils.loadNormal(context, it,holder.getView(R.id.msg_img2)) }
        }
        if(item.img3!=""){
            item.img3?.let { GlideUtils.loadNormal(context, it,holder.getView(R.id.msg_img3)) }
        }
    }
}